<!--
 * @Descripttion:
 * @version:
 * @Author: 韩应波
 * @Date: 2020-12-10 10:45:09
 * @LastEditors: 韩应波
 * @LastEditTime: 2020-12-22 13:57:31
-->
<template>
  <div class="app-container">
    <el-form
      ref="listFilterRef"
      :model="list.filter"
      inline
      class="list-filter"
    >
      <!-- <el-form-item prop="phone" :verify="{ required: false, type: 'phone' }">
        <el-input v-model="list.filter.phone" placeholder="手机号" clearable>
          <i slot="prefix" class="el-input__icon el-icon-search" />
        </el-input>
      </el-form-item> -->
      <el-form-item prop="id">
        <el-input v-model="list.filter.id" placeholder="用户Id" clearable>
          <i slot="prefix" class="el-input__icon el-icon-search" />
        </el-input>
      </el-form-item>
      <el-form-item>
        <el-button @click="reset">
          重置
        </el-button>
      </el-form-item>
    </el-form>

    <div class="table-operation">
      <div></div>
      <el-pagination
        v-bind="elPaginationProps"
        :total="list.total"
        :currentPage.sync="list.filter.pageNo"
        :pageSize.sync="list.filter.pageSize"
      />
    </div>

    <el-table v-loading="list.loading" :data="list.data" v-bind="tableProp">
      <el-table-column label="用户Id" align="center" prop="id" />
      <el-table-column label="昵称" align="center" prop="nick" />
      <el-table-column label="手机号" align="center" prop="phone" />
      <el-table-column label="微信OpenID" align="center" prop="openId" />
      <el-table-column label="创建时间" align="center" prop="createTime" />
      <!-- <el-table-column label="启用状态" width="80" align="center">
        <template slot-scope="{ row: { id, status } }">
          <KiPopSwitch
            v-bind="popSwitchProps(status)"
            @change="updateStatus({ id, status: status ^ 1 })"
          />
        </template>
      </el-table-column> -->
    </el-table>
  </div>
</template>

<script>
import pageMixin from '@/utils/pageMixin'
import useAdmateAdapter from '@/utils/useAdmateAdapter'

export default {
  mixins: [pageMixin],
  setup: () =>
    useAdmateAdapter({
      urlPrefix: 'one-travel-api/app-user',
      list: {
        filter: {
          phone: '',
          id: ''
        }
      }
    })
}
</script>

<style lang="scss" scoped></style>
